﻿using Naruto.TaskManagement.Entitys.Models;
using Naruto.TaskManagement.Entitys.VM;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Naruto.TaskManagement.IRepository
{
    public interface ITaskRecordRepository
    {
        /// <summary>
        /// 新增
        /// </summary>
        /// <returns></returns>
        Task Add(TaskRecord info);
        /// <summary>
        /// 分页获取数据
        /// </summary>
        /// <param name="status">任务状态</param>
        /// <param name="title">标题</param>
        /// <param name="type"></param>
        /// <param name="userName">用户名</param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="organizationId">组织id</param>
        /// <returns></returns>
        Task<(List<TaskRecordGetListByPageViewModel> list, int count)> GetListByPage(int status, string organizationId, string title, int type, string userName, int pageIndex, int pageSize);

        /// <summary>
        /// 获取数据总数
        /// </summary>
        /// <param name="title">标题</param>
        /// <param name="type"></param>
        /// <param name="userName">用户名</param>
        /// <param name="organizationId">组织id</param>
        /// <returns></returns>
        Task<GetListCountViewModel> GetListCount(string organizationId, string title, int type, string userName);

        /// <summary>
        /// 获取单条信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<TaskRecordGetByIdViewModel> GetById(string id);
        /// <summary>
        /// 获取单条信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<TaskRecordGetAllByIdViewModel> GetAllById(string id);
        /// <summary>
        /// 修改状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status">状态</param>
        /// <param name="operationUser">操作人</param>
        /// <param name="remark">备注信息</param>
        /// <returns></returns>
        Task UpdateStatus(string id, int status, string operationUser, string remark);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task Delete(string id, string operationUser);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="id"></param>
        /// <param name="title"></param>
        /// <param name="description"></param>
        /// <param name="level"></param>
        /// <param name="endDate"></param>
        /// <param name="appointUser"></param>
        /// <returns></returns>
        Task Update(string id, string title, string description, int level, DateTime endDate, string appointUser);

        /// <summary>
        /// 获取我的任务数
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        Task<(int myCreateCount, int appointMyTask)> GetMyTaskCount(string userName);
    }
}
